package uml.construct.builder;

/**
 * 建造者--指挥者<br>
 * 针对抽象建造者编程<br>
 * on 2022/12/17 20:03
 */
public class ActorDirector {
    private ActorBuilder actorBuilder;

    /**
     * 封装复杂对象的建造次序（此逻辑可封装到抽象指挥者内部）
     */
    public void build(ActorBuilder actorBuilder) {
        this.actorBuilder = actorBuilder;
        actorBuilder.buildType();
        actorBuilder.buildSex();
        actorBuilder.buildFace();
        actorBuilder.buildCustom();
        actorBuilder.buildHairStyle();
    }

    public Actor getActor() {
        return this.actorBuilder.getActor();
    }
}
